/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */
package cn.reg;

import java.util.regex.Pattern;

/**
 * <p>Project: jse2302 - RegExp9
 * <p>Powered by webrx On 2023-06-20 18:02:25
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class RegExp9 {
    public static void main(String[] args) {
        String str = """
				<div>ok</div><div>hello12121java17</div><div>java 15</div><div><p>java 15</p><span>java 8</p><div>hello java 158</div></div><div><div>java</div></div>
				""";
        //要求将div标签有java的标签，换成p  <div>java17</div> 换成</p>java17</p>

        String p = "<div>([^java]*?java[^java]*?)</div>";

        System.out.println(str);

        System.out.println();

        System.out.println(str.replaceAll(p,"<p>$1</p>"));

    }
}
